package cn.ahaoweb.drule.core.model.info;

import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * @Name: 字段信息
 * @Description:
 * @Author: wangzhonghao
 * @Date: 2025/1/26 16:22
 */
@Getter
@Setter
public class FieldInfo extends BaseInfo{

    /**
     * 默认值
     */
    private String defaultValue;


    public static final class FieldInfoBuilder {
        private FieldInfo fieldInfo;

        private FieldInfoBuilder() {
            fieldInfo = new FieldInfo();
        }

        public static FieldInfoBuilder builder() {
            return new FieldInfoBuilder();
        }

        public FieldInfoBuilder name(String name) {
            fieldInfo.setName(name);
            return this;
        }

        public FieldInfoBuilder code(String code) {
            fieldInfo.setCode(code);
            return this;
        }

        public FieldInfoBuilder path(String path) {
            fieldInfo.setPath(path);
            return this;
        }

        public FieldInfoBuilder fqcn(String fqcn) {
            fieldInfo.setFqcn(fqcn);
            return this;
        }

        public FieldInfoBuilder properties(Map<String, String> properties) {
            fieldInfo.setProperties(properties);
            return this;
        }

        public FieldInfoBuilder defaultValue(String defaultValue) {
            fieldInfo.setDefaultValue(defaultValue);
            return this;
        }

        public FieldInfo build() {
            return fieldInfo;
        }
    }
}
